package main

import "fmt"

func main() {

	// 位运算的演示
	fmt.Println(2 & 3)  // 2
	fmt.Println(2 | 3)  // 3
	fmt.Println(2 ^ 3)  // 3
	fmt.Println(-2 ^ 2) //-4

	a := 1 >> 2 //0
	c := 1 << 2 //4
	fmt.Println("a=", a, "c=", c)

	//var a int = 1 >> 2
	//var b int = -1 >> 2
	//var c int = 1 << 2
	//var d int = -1 << 2
	////a,b,c,d 结果是多少
	//fmt.Println("a=", a)
	//fmt.Println("b=", b)
	//fmt.Println("c=", c)
	//fmt.Println("d=", d)
	//
	//fmt.Println(2&3)
	//fmt.Println(2|3)
	//fmt.Println(13&7)
	//fmt.Println(5|4)
	//fmt.Println(-3^3)

}
